import random

random.seed(32)


# State:阶段，即工件有几道工序，Job:工件数，Machine['type':list],对应各阶段的并行机数量
def Generate(State, Job, Machine):
    PT = []
    for i in range(State):
        Si = []  # 第i各加工阶段
        for j in range(Machine[i]):
            S0 = [random.randint(17, 20) for k in range(Job)]
            Si.append(S0)
        PT.append(Si)
    return PT


Job = 20
State = 1
Machine = [3, 3, 3]

PT = Generate(State, Job, Machine)

# PT = [[[17, 17, 17, 20, 20, 17, 20, 20, 17, 17, 17, 20, 17, 20, 17, 20, 20, 20, 17, 17],
#        [18, 18, 18, 22, 22, 18, 22, 22, 18, 18, 18, 22, 18, 22, 18, 22, 22, 22, 18, 18],
#        [19, 19, 19, 21, 21, 19, 21, 21, 19, 19, 19, 21, 19, 22, 19, 21, 21, 21, 19, 19]]]

# PT = [[[17, 17, 17, 20, 20, 17, 20, 20, 17, 17, 17, 20, 17, 20, 17, 20, 20, 20, 17, 17],
#        [18, 18, 18, 22, 22, 18, 22, 22, 18, 18, 18, 22, 18, 22, 18, 22, 22, 22, 18, 18],
#        [19, 19, 19, 21, 21, 19, 21, 21, 19, 19, 19, 21, 19, 22, 19, 21, 21, 21, 19, 19]]]
